package lanou.autohome.findcar.fragments;

import android.widget.ListView;

import lanou.autohome.URLValues;
import lanou.autohome.basetool.BaseFragment;
import lanou.autohome.R;
import lanou.autohome.basetool.NetTool;
import lanou.autohome.findcar.adapters.MorkDownAdapter;
import lanou.autohome.findcar.beans.MorkDownBean;

/**
 * Created by dllo on 16/8/16.
 * 找车 -> 降价
 */
public class MorkDownFragment extends BaseFragment{


    private ListView listView;

    @Override
    protected int setLayout() {
        return R.layout.fragment_findcar_morkdown;
    }

    @Override
    protected void initView() {
        listView = bindVie(R.id.listview_morkdown_findcar);
    }

    @Override
    protected void intiData() {
    final MorkDownAdapter morkDownAdapter = new MorkDownAdapter(mcontext);
        mNetTool.getNetData(URLValues.DEPRECIATE_URL, MorkDownBean.class, new NetTool.NetListener<MorkDownBean>() {
            @Override
            public void onSuccess(MorkDownBean morkDownBean) {
                morkDownAdapter.setMorkDownBean(morkDownBean);
                listView.setAdapter(morkDownAdapter);
            }

            @Override
            public void onError(String errorMsg) {

            }
        });
    }
}
